home *** CD-ROM | disk | FTP | other *** search
/ A Virtual Reality Guide to Texas / CD.iso / texdata / vrxtra.cst / 00003_pano callbacks.ls < prev    next >
Encoding:
Text File  |  1998-06-17  |  8.4 KB  |  281 lines

  1. -- InitPanoCallbacks
  2. --
  3. -- Initializes the callbacks used for panoramic movies.
  4. -------------------------------------------------------------------------------
  5. on InitPanoCallbacksXtra
  6.   global gQTVRInstanceXtra
  7.   
  8.  
  9.   if not VOIDP(gQTVRInstanceXtra) then
  10.    
  11.     if IsQTVRMovie(gQTVRInstanceXtra) then
  12.     
  13.       QTVRSetRolloverHotSpotHandler(gQTVRInstanceXtra,"RolloverHandlerXtra")
  14.       --QTVRSetMouseOverHandler(gQTVRInstanceXtra,"MouseOverHandlerXtra")
  15.       --QTVRSetMouseDownHandler(gQTVRInstanceXtra,"MouseDownHandlerXtra")
  16.       
  17.       -- replaced following with above JHB 4/11
  18.       
  19.       --QTVRSetRolloverHotSpotHandler(gQTVRInstanceXtra,empty)
  20.       QTVRSetMouseOverHandler(gQTVRInstanceXtra,empty)
  21.       QTVRSetMouseDownHandler(gQTVRInstanceXtra,empty)
  22.       QTVRSetPanZoomStartHandler(gQTVRInstanceXtra,empty)
  23.       QTVRSetMouseStillDownHandler(gQTVRInstanceXtra,empty)
  24.       QTVRSetNodeLeaveHandler(gQTVRInstanceXtra,empty)
  25.     end if
  26.   else
  27.     
  28.   end if
  29.   
  30.   
  31.   
  32.  
  33.   
  34. end
  35.  
  36.  
  37. --=============================================================================
  38. -- XCMD Callback Factory
  39. -------------------------------------------------------------------------------
  40.  
  41.  
  42.  
  43. --=============================================================================
  44. -- CallBackTracer
  45. --
  46. -- As described in "Using Lingo", Appendix A.  Pass any mSendCardMessage
  47. -- commands on to Lingo so that callbacks can be handled.
  48. -- used only on Mac
  49. -------------------------------------------------------------------------------
  50. factory CallBackTracer
  51.   
  52. method mNew
  53.   
  54. method mEvalExpr pExpr
  55.   
  56. method mSendHCMessage pMessage
  57.   
  58. method mSendCardMessage pMessage
  59.   do pMessage
  60.   
  61. method mGetFieldByName pCard, pName
  62.   
  63. method mGetFieldByNum pCard, pNum
  64.   
  65. method mGetFieldByID pCard, pID
  66.   
  67. method mSetFieldByName pCard, pName, pValue
  68.   
  69. method mSetFieldByNum pCard, pNum, pValue
  70.   
  71. method mSetFieldByID pCard, pID, pValue
  72.   
  73. end
  74.  
  75.  
  76. --=============================================================================
  77. -- Routines used by Pano Callbacks screens
  78. -------------------------------------------------------------------------------
  79.  
  80.  
  81. on TestMouseOverHandlerXtra
  82.   global gQTVRInstanceXtra
  83.   if IsQTVRMovie(gQTVRInstanceXtra) then
  84.     put "In mouse over at: " & the ticks into member "MouseOverHandler Message"
  85.   end if
  86. end
  87.  
  88. on TestRolloverHotSpotHandlerXtra pHotSpotID
  89.   global gQTVRInstanceXtra
  90.   if IsQTVRMovie(gQTVRInstanceXtra) then
  91.     if pHotSpotID = 0 then
  92.       put "ID: " & pHotSpotID & RETURN & "Name:" into member "RolloverHotSpotHandler Message"
  93.     else
  94.       QTVRSetHotSpotID(gQTVRInstanceXtra, integer(pHotSpotID))
  95.       set spotName = QTVRGetHotSpotName(gQTVRInstanceXtra)
  96.       put "ID: " & pHotSpotID & RETURN & "Name: " & spotName into member "RolloverHotSpotHandler Message"
  97.     end if
  98.   end if
  99. end
  100.  
  101. on TestMouseDownHandlerXtra
  102.   global gQTVRInstanceXtra
  103.   if IsQTVRMovie(gQTVRInstanceXtra) then
  104.     put "In mouse down at: " & the ticks into member "MouseDownHandler Message"
  105.     QTVRPassMouseDown(gQTVRInstanceXtra)
  106.   end if
  107. end
  108.  
  109. on TestPanZoomStartHandlerXtra
  110.   global gQTVRInstanceXtra
  111.   if IsQTVRMovie(gQTVRInstanceXtra) then
  112.     put "In pan zoom start at: " & the ticks into member "PanZoomStartHandler Message"
  113.   end if
  114. end
  115.  
  116. on TestMouseStillDownHandlerXtra
  117.   global gQTVRInstanceXtra
  118.   if IsQTVRMovie(gQTVRInstanceXtra) then
  119.     put "In mouse still down at: " & the ticks into member "MouseStillDownHandler Message" 
  120.     put RETURN & QTVRGetPanAngle(gQTVRInstanceXtra) after member "MouseStillDownHandler Message"
  121.   end if
  122. end
  123.  
  124. on TestNodeLeaveHandlerXtra pToNode
  125.   global gQTVRInstanceXtra
  126.   if IsQTVRMovie(gQTVRInstanceXtra) then
  127.     put "Leaving node ID: " & pToNode into member "NodeLeaveHandler Message"
  128.   end if
  129. end
  130.  
  131. --------------------
  132. --TDC mouse routines
  133. ------------------
  134. --=============================================================================
  135. -- MouseOverHandler
  136. --
  137. -- Called by PanoMovie periodically during mouseOver.
  138. -------------------------------------------------------------------------------
  139. on MouseOverHandlerXtra
  140.   global gQTVRInstanceXtra
  141.   --put "Mouse over panoramic movie"
  142.   -- If you want to exit from mouseOver, use this line
  143.   global gQTVRInstanceXtra
  144.   if IsQTVRMovie(gQTVRInstanceXtra) then
  145.     -- QTVRExitMouseOver(gQTVRInstanceXtra)
  146.   end if
  147. end
  148.  
  149.  
  150. --=============================================================================
  151. --      pHotSpotID is the id of the hot spot the user is over
  152. --
  153. -- Called by PanoMovie whenever the hot spot the cursor is over changes.
  154. -- Used by TDC movie
  155. -------------------------------------------------------------------------------
  156. on RolloverHandlerXtra pHotSpotID
  157.   global gQTVRInstanceXtra, gHotSpot
  158.   
  159.   --put QTVRGetHotSpotID(gQTVRInstanceXtra)
  160.   --put pHotSpotID
  161.   put integer(pHotSpotID) into gHotSpot
  162.   checkCurrentVRHotSpot
  163.   --put pHotSpotID into cast "Current Hot Spot ID"
  164. end
  165.  
  166.  
  167. --=============================================================================
  168. -- SampleMouseDownHandler
  169. --
  170. -- Called by PanoMovie when a mouseDown event occurs during a mouseOver call
  171. -------------------------------------------------------------------------------
  172.  
  173. -- is this script needed?
  174. -- disable in the pano callbacks script
  175. -- JHB
  176.  
  177. on MouseDownHandlerXtra
  178.   --put "Mouse down during mouseOver call"
  179.   put QTVRGetHotSpotID(gQTVRInstanceXtra)
  180.   
  181.   global gPanoMovieID
  182.   if IsQTVRMovie(gQTVRInstanceXtra) then
  183.     QTVRPassMouseDown(gQTVRInstanceXtra)
  184.   end if
  185. end
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194. --=============================================================================
  195.  
  196.  
  197.  
  198.  
  199.  
  200. --=============================================================================
  201. -- Sample PanoMovie callback handler routines
  202. -------------------------------------------------------------------------------
  203.  
  204. --=============================================================================
  205. -- SampleMouseOverHandler
  206. --
  207. -- Called by PanoMovie periodically during mouseOver.
  208. -------------------------------------------------------------------------------
  209. on SampleMouseOverHandlerXtra
  210.   put "Mouse over panoramic movie"
  211.   -- If you want to exit from mouseOver, use this line
  212.   global gQTVRInstanceXtra
  213.   if IsQTVRMovie(gQTVRInstanceXtra) then
  214.     -- QTVRExitMouseOver(gQTVRInstanceXtra)
  215.   end if
  216. end
  217.  
  218. --=============================================================================
  219. -- SampleRolloverHandler
  220. --      pHotSpotID is the id of the hot spot the user is over
  221. --
  222. -- Called by PanoMovie whenever the hot spot the cursor is over changes.
  223. -------------------------------------------------------------------------------
  224. on SampleRolloverHotSpotHandlerXtra pHotSpotID
  225.   global gQTVRInstanceXtra
  226.   
  227.   --  put QTVRGetHotSpotID(gQTVRInstanceXtra) into member "Current Hot Spot ID"
  228.   put pHotSpotID into cast "Current Hot Spot ID"
  229. end
  230.  
  231.  
  232.  
  233. --=============================================================================
  234. -- SampleMouseDownHandler
  235. --
  236. -- Called by PanoMovie when a mouseDown event occurs during a mouseOver call
  237. -------------------------------------------------------------------------------
  238. on SampleMouseDownHandler
  239.   put "Mouse down during mouseOver call"
  240.   
  241.   global gPanoMovieID
  242.   if IsQTVRMovie(gQTVRInstanceXtra) then
  243.     QTVRPassMouseDown(gQTVRInstanceXtra)
  244.   end if
  245. end
  246.  
  247. --=============================================================================
  248. -- SamplePanZoomStartHandler
  249. --
  250. -- Called once by PanoMovie when the user starts to pan or zoom.
  251. -------------------------------------------------------------------------------
  252. on SamplePanZoomStartHandlerXtra
  253.   put "About to pan or zoom in panoramic movie"
  254. end
  255.  
  256. --=============================================================================
  257. -- SampleMouseStillDownHandler
  258. --
  259. -- Called by PanoMovie periodically during while the mouse is down within
  260. -- mouseOver or mouseDown.
  261. -------------------------------------------------------------------------------
  262. on SampleMouseStillDownHandlerXtra
  263.   put "Enter mouse still down from panoramic movie"
  264.   global gQTVRInstanceXtra
  265.   if IsQTVRMovie(gQTVRInstanceXtra) then
  266.     -- put QTVRGetPanAngle(gQTVRInstanceXtra) into tPanAngle 
  267.     -- put "PanAngle is currently: " & tPanAngle
  268.   end if
  269.   put "Leave mouse still down from panoramic movie"
  270. end
  271.  
  272. --=============================================================================
  273. -- SampleNodeLeaveHandler
  274. --      pToNodeID is the id of the node the user is leaving
  275. --
  276. -- Called by PanoMovie when the user moves between nodes by clicking on link
  277. -- hot spots.
  278. -------------------------------------------------------------------------------
  279. on SampleNodeLeaveHandlerXtra pToNode
  280.   put "Jumping to node " & pToNode & " in panoramic movie"
  281. end